package main

import (
	"fmt"
	"reflect"
)

type IFly interface {
	Fly()
}

type Bird struct {
	Name string
}

func (b *Bird) Fly() {
	fmt.Println("im flying...")
}

func main() {

	bird := &Bird{}                          //声明Bird指针变量
	t := reflect.TypeOf((*IFly)(nil)).Elem() //返回IFly接口类型

	refType := reflect.TypeOf(bird)
	//通过reflect.Implements(t)判断refType是否实现了IFly接口
	fmt.Println(refType.Implements(t))
}
